import { MockMethod } from 'vite-plugin-mock';
import { resultPageSuccess, resultSuccess } from '../_util';

const demoList = (() => {
  const result: any[] = [];
  for (let index = 0; index < 60; index++) {
    result.push({
      id: `${index}`,
      deviceName: '@ctitle',
      serialNumber: '@string(lower,10)',
      deviceModel: '@string(lower,10)',
      'useState_dictText|1': ['在用', '停用'],
      'useState|1': ['1', '2'],
      'onlineStatus_dictText|1': ['在线', '离线'],
      'onlineStatus|1': ['1', '2'],
      'position_dictText|1': ['5楼', '501室', '6楼'],
      'position|1': ['1710536239989846017', '1710528691173781505', '1712374277523042305', '1710529279416528897'],
      createTime: '@time',
    });
  }
  return result;
})();

enum Api {
  list = '/antenna/antenna/list',
  save = '/antenna/antenna/add',
  edit = '/antenna/antenna/edit',
  deleteOne = '/antenna/antenna/delete',
  deleteBatch = '/antenna/antenna/deleteBatch',
  importExcel = '/antenna/antenna/importExcel',
  exportXls = '/antenna/antenna/exportXls',
}

const prefix = '/jeecgboot';
export default [
  // {
  //   url: prefix + Api.list,
  //   timeout: 1000,
  //   method: 'get',
  //   response: ({ query }) => {
  //     const { page = 1, pageSize = 20 } = query;
  //     return resultPageSuccess(page, pageSize, demoList);
  //   },
  // },
  // {
  //   url: prefix + Api.save,
  //   timeout: 1000,
  //   method: 'post',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
  // {
  //   url: prefix + Api.edit,
  //   timeout: 1000,
  //   method: 'post',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
  // {
  //   url: prefix + Api.deleteOne,
  //   timeout: 1000,
  //   method: 'delete',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
  // {
  //   url: prefix + Api.importExcel,
  //   timeout: 1000,
  //   method: 'post',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
  // {
  //   url: prefix + Api.exportXls,
  //   timeout: 1000,
  //   method: 'get',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
] as MockMethod[];
